import { fromJS } from 'immutable'
import mutation from '../mutations/cookbookMutation'

// 初始化数据，全为immutable对象
const defaultState = fromJS({
  swiper: null,
  hotcate: null,
  goodfood: null
})

export default (state = defaultState, { type, data = null }) => {
  try {
    return mutation[type](state, data)
  } catch (error) {
    return state
  }
}


